//logs.js
var util = require('../../utils/util.js')
Page({
   data: {
    item: {
      display: 'hide',
      error_info: '请添加对局信息',
    },
    select: ['/image/select.png','',''],
    value:1
  },
  
  onShow:function(){
      var battle_type = wx.getStorageSync('battle_type');
      var select      = [];
      var value       = '';
      switch (battle_type) {
        case 2:
          select = ['', '/image/select.png', ''];
          value  = battle_type;
          break;
        case 3:
          select = ['', '', '/image/select.png'];
          value  = battle_type;
          break;
        default:
          select = ['/image/select.png', '', ''];
          value = battle_type;
          break;
      }
      
      this.setData({
        select: select,
        value: value
      })

  },

   selectEightBall:function(){
     this.setData({
       select: ['/image/select.png', '', ''],
       value: 1
     })
   },
   
   selectSnooker: function () {
     this.setData({
       select: ['', '/image/select.png', ''],
       value: 2
     })
   },

   selectNineBall: function () {
     this.setData({
       select: ['', '', '/image/select.png'],
       value: 3
     })
   },
   doSave:function(){
      wx.setStorage({
        key: "battle_type",
        data: this.data.value
      });
      wx.navigateBack(1);
   }
 
})
